package com.uzhie.media;

import io.netty.channel.ChannelHandlerContext;

/**
 * Created by TangFei on 2018/9/12.
 * 流媒体 ChannelHandlerContext 保持
 */
public class MediaChannelHandlerContextHolder {

    private static ThreadLocal<ChannelHandlerContext> contextThreadLocal = new ThreadLocal<>();

    public static void setContextThreadLocal(ChannelHandlerContext handlerContext) {
        contextThreadLocal.set(handlerContext);
    }

    public static ChannelHandlerContext getContextThreadLocal() {
        return contextThreadLocal.get();
    }

    public static void removeContextThreadLocal() {
        contextThreadLocal.remove();
    }

}
